﻿<Page
    x:Class="Ch9RSS_Universal.ItemPage"
    DataContext="{Binding DefaultViewModel.Item, RelativeSource={RelativeSource Self}}"
    d:DataContext="{Binding Groups[0].Items[0], Source={d:DesignData Source=../Ch9RSS_Universal.Shared/DataModel/SampleData.json, Type=data:SampleDataSource}}"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Ch9RSS_Universal"
    xmlns:data="using:Ch9RSS_Universal.Data"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:play="using:Microsoft.PlayerFramework"
    xmlns:convert="using:Ch9RSS_Universal.Converters"
    mc:Ignorable="d"
    Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <Page.Transitions>
        <TransitionCollection>
            <NavigationThemeTransition>
                <NavigationThemeTransition.DefaultNavigationTransitionInfo>
                    <ContinuumNavigationTransitionInfo></ContinuumNavigationTransitionInfo>
                </NavigationThemeTransition.DefaultNavigationTransitionInfo>
            </NavigationThemeTransition>
        </TransitionCollection>
    </Page.Transitions>
    <Page.Resources>
        <convert:GroupToMediaConverter x:Key="GroupToMedia" />
    </Page.Resources>
    <Grid x:Name="LayoutRoot">
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition/>
            </TransitionCollection>
        </Grid.ChildrenTransitions>

        <Grid.RowDefinitions>
            <RowDefinition x:Name="TopRow" Height="Auto"/>
            <RowDefinition x:Name="MiddleRow" Height="Auto"/>
            <RowDefinition x:Name="BottomRow" Height="*" />
        </Grid.RowDefinitions>

        <!-- TitlePanel -->
        <StackPanel Grid.Row="0" Margin="0,0,0,0" Background="{StaticResource Ch9Orange}">
        <TextBlock Margin="12,5,0,5" Foreground="White"  Text="CHANNEL 9 VIEWER" Style="{ThemeResource TitleTextBlockStyle}" Typography.Capitals="SmallCaps"/>
        </StackPanel>

        <!--TODO: Content should be placed within the following grid 
                  to show details for the current item -->
        <!--<MediaElement x:Name="itemVideo"
                Grid.Row="1"
                Source="{Binding Ch9Post.group, Converter={StaticResource GroupToMedia}}"
                AutoPlay="True" CurrentStateChanged="StateChanged"
                
                      >
        </MediaElement>-->

        <play:MediaPlayer 
                x:Name="sidePlayer" 
                Grid.Row="1" 
                Margin="20" 
                IsPauseEnabled="True"
                Source="{Binding Ch9Post.group, Converter={StaticResource GroupToMedia}}" 
                
                AutoPlay="False" 
                IsFullScreenVisible="True"
                IsFullScreenChanged="sidePlayer_IsFullScreenChanged" 
                IsPauseAllowedChanged="PauseAllowedChanged" 
                MediaOpened="MediaOpened" 
                />
        
        <Grid  x:Name="ContentRoot" Grid.Row="2">
            <WebView x:Name="itemContentView" ></WebView>
                
                
            
            <!--<play:MediaPlayer 
                x:Name="sidePlayer" 
                Grid.Row="1" 
                Margin="20" 
                Source="{Binding Ch9Post.group, Converter={StaticResource GroupToMedia}}" 
                AutoPlay="False" 
                IsFullScreenVisible="True"
                IsFullScreenChanged="sidePlayer_IsFullScreenChanged"/>-->
        </Grid>
    </Grid>
</Page>
